# -*- coding: utf-8 -*-
# @Time    : 2022/7/15 21:10
# @Author  : catherine
# @Email   : catherine_csq@163.com
# @File    : home_page.py
# @Software: PyCharm

from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class HomePage(BasePage):
    '''个人主页类'''
    url='http://192.168.189.1:8081/crm/index.php?m=dynamic&a=index'
    #定位器
    index_clue_locator = (By.LINK_TEXT, '线索')
    customer_locator = (By.LINK_TEXT, '客户')
    goods_locator = (By.CSS_SELECTOR,'body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul:nth-child(1) > li:nth-child(7) > a')

    def click_index_clue(self):
        '''点击导航栏-线索'''
        # self.driver.find_element(*self.index_clue_locator).click()
        self.find_element(self.index_clue_locator).click()

    def click_customer(self):
        '''点击导航栏-客户'''
        # self.driver.find_element(*self.customer_locator).click()
        self.find_element(self.customer_locator).click()

    def click_goods(self):
        self.driver.find_element(*self.goods_locator).click()



    # def __init__(self,driver):
    #     self.driver=driver

    # def open(self):
    #     '''打开页面'''
    #     self.driver.get(self.url)
    #
    # def current_url(self):
    #     '''获取当前界面url'''
    #     return self.driver.current_url